<div data-role="header" id="header" data-nobackbtn="true">
	<a data-icon="arrow-l" rel="external" href="<?php echo WEB_ROOT?>webmail/menu">Retour</a>
	<h1>Brouillons</h1>
</div><!-- /header -->

<div data-role="content" id="content">
	
	<ul class="list" id="maillist" data-role="listview" data-theme="c">
		<?php if(count($emails) == 0): ?>
		<li>Aucun brouillon</li>
		<?php else : ?>
		<?php foreach($emails as $email): ?>
		<li>
			<a href="<?php echo WEB_ROOT ?>compose/draft/<?php echo $email->uid; ?>">
				<div>
					<div class="ui-btn-inner">
						<div class="ui-btn-text" style="padding:7px 30px 0 7px;"> 
							<h2 class="ui-li-heading" style="margin-top: 0px;" ><?php echo $email->to; ?></h2>
							<p class="ui-li-desc"><strong><?php echo $email->subject; ?></strong></p>
							<p class="ui-li-desc"><?php echo date('d/m/Y H:i',strtotime($email->date)) ?></p>
						</div>
					</div>
				</div>
			</a>
		</li>
		<?php endforeach; ?>
		<?php endif; ?>
	</ul>
	
</div><!-- /content -->

<div data-role="footer" id="footer">
	<div style="float: left; margin-left: 20%">
		<a href="<?php echo WEB_ROOT; ?>compose/index" rel="external">
			<div style="width: 32px; height: 32px; line-height: 32px; text-align: center;">
				<img src="<?php echo WEB_ROOT; ?>assets/img/pencil-icon_big.png" alt="Ecrire" style="vertical-align: middle;" />
			</div>
		</a>
	</div>
	<div style="float: right; margin-right: 20%">
		<a id="deco" onClick="if(confirm('Voulez-vous vraiment vous déconnecter ?')){this.setAttribute('href', '<?php echo WEB_ROOT; ?>member/logout');}" rel="external">
			<div style="width: 32px; height: 32px; line-height: 32px; text-align: center;">
				<img src="<?php echo WEB_ROOT; ?>assets/img/logout.png" style="vertical-align: middle;" alt="Logout" />
			</div>
		</a>
	</div>
</div><!-- /footer -->

<style>
	.list .ui-li .ui-btn-inner { padding:0;}
</style>
